using Godot;
using GoGameClient.script.tool;

namespace GoGameClient.script.node.caption;

public partial class Caption : Node
{
    private Control _registerControl;

    // Called when the node enters the scene tree for the first time.
    public override void _Ready()
    {
        _registerControl = GetNode<Control>("RegisterGUI");
        if (Config.GetLogin())
        {
            GetNode<Control>("NoticeGUI").Visible = false;
            GetNode<Control>("LoginGUI").Visible = true;
        }
        else
        {
            GetNode<Control>("NoticeGUI").Visible = true;
            GetNode<Control>("LoginGUI").Visible = false;
        }
    }


    private void ReturnButtonPressed()
    {
        GetNode<Control>("NoticeGUI").Visible = true;
        GetNode<Control>("LoginGUI").Visible = false;
    }

    private void ExitButtonPressed()
    {
        GetTree().Quit();
    }


    private void NextButtonPressed()
    {
        GetNode<Control>("NoticeGUI").Visible = false;
        GetNode<Control>("LoginGUI").Visible = true;
    }

    private void RegisterButtonPressed()
    {
        _registerControl.Visible = !_registerControl.Visible;
    }
}